package com.jlt.web;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.opensymphony.xwork2.ActionSupport;
import com.opensymphony.xwork2.ModelDriven;

/**
 * Struts2中典型Action的抽象基类.
 * 
 * @param <T> query action所管理的对象类型.
 * 
 * @author zhoutao
 */
@SuppressWarnings("serial")
public abstract class QueryActionSupport<T> extends ActionSupport  implements ModelDriven<T>{

	protected Logger logger = LoggerFactory.getLogger(getClass());

	/**
	 * Action函数, 默认的action函数, 默认调用list()函数.
	 */
	@Override
	public String execute() throws Exception {
		return list();
	}

	//-- 查询函数 --//
	/**
	 * 建议return SUCCESS.
	 */
	public abstract String list() throws Exception;

}
